import { request } from '@boeyo/portal';

/**
 * 列表
 */
export const fetchList = (params) => {
  return request({
    url: 'project/list',
    method: 'GET',
    params,
  });
};

/**
 * 新增项目
 * @ss.hasPermi('project:add')
 */
export const projectAdd = (data) => {
  return request({
    url: 'project/add',
    method: 'POST',
    data,
  });
};

/**
 * 修改项目
 * @ss.hasPermi('project:update')
 */
export const projectUpdate = (data) => {
  return request({
    url: 'project/update',
    method: 'PUT',
    data,
  });
};

/**
 * 删除项目
 * @ss.hasPermi('project:delete')
 */
export const projectDelete = (data) => {
  return request({
    url: `project/delete/${data}`,
    method: 'DELETE',
  });
};

/**
 * 通用上传请求（单个）
 */
export const uploadFile = (data) => {
  return request({
    url: '/common/upload',
    method: 'POST',
    data,
  });
};

/**
 * 查询预警等级配置列表
 * @ss.hasPermi('levelConfig:list')
 */
export const fetchLevelConfigList = (params = {}) => {
  return request({
    url: '/levelConfig/list',
    method: 'GET',
    params,
  });
};
